<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Webpage extends Model
{
    
    protected $table = 'webpage';

    protected $primaryKey = 'id';

    public $timestamps = false;
	
	protected $appends = ['edit_time_format','add_time_format','operation'];
	
	public function getEditTimeFormatAttribute()
    {
        $result = $this->edit_time ? date("Y-m-d H:i:s", $this->edit_time):'';
		return $result;
    }
	
	public function getAddTimeFormatAttribute()
    {
        $result = $this->add_time ? date("Y-m-d H:i:s", $this->add_time):'';
		return $result;
    }
	
	public function getOperationAttribute()
    {
        $html  = "<i class='fa fa-edit' onclick=layOpenView('/admin/webpage/editview/{$this->id}','90%','90%','信息编辑')></i>";
		return $html;
    }


}
